<template>
    <el-dialog title="更改收房时间" class="setTime" width="350px" :visible.sync="isDial">
    <el-form :model="form">
        <el-form-item label="更改时间为" :label-width="formLabelWidth">
            <el-date-picker v-model="form.time" size='mini' style="width:180px;" :picker-options="pickerOptions0" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
        </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" size="mini" @click="saveTime">查 询</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { request } from "../../assets/request.js";
export default {
    data(){
        return{
            form:{
                time:"",
            },
            formLabelWidth:'90px',
            isDial:false,
            pickerOptions0: {
            disabledDate(time) {
                return time.getTime() < Date.now() - 8.64e7;
            }
          },
        }
    },
    created(){
        let that = this;
        this.$root.$on("setTime", (data) => {
            this.isDial=true
            let form =this.form
            form.time=data
        });
    },
    methods:{
        saveTime(){
            let form=this.form
            this.$root.$emit('saveTime',form.time)
            this.isDial=false
        }
    }
}
</script>
<style lang="less" scoped>
.setTime{
    text-align: left;
}
</style>
